<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>实装信息编辑</title>
	<meta name="description" content="试验装备管理软件">
	<!-- Bootstrap CSS -->
	<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
	<!-- 字体CSS -->
	<link href="assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
	<!-- 自定义样式 -->
	<link href="assets/css/style.css" rel="stylesheet" type="text/css" />

	<link href="assets/plugins/datetimepicker/css/daterangepicker.css" rel="stylesheet" />
	<link rel="stylesheet" href="./assets/layui/css/layui.css">
	<style>
		.parsley-error {
			border-color: #ff5d48 !important;
		}

		.parsley-errors-list.filled {
			display: block;
		}

		.parsley-errors-list {
			display: none;
			margin: 0;
			padding: 0;
		}

		.parsley-errors-list>li {
			font-size: 12px;
			list-style: none;
			color: #ff5d48;
			margin-top: 5px;
		}

		.form-section {
			padding-left: 15px;
			border-left: 2px solid #FF851B;
			display: none;
		}

		.form-section.current {
			display: inherit;
		}

		body {
			padding-bottom: 0;
		}

		.card-height .form-group {
			margin-top: 40px;
		}

		.card-height .form-group:first-of-type {
			margin-top: 0;
		}
		/* 新增样式 */
		.sub-text{
			color:#95a1ab;
		}
		.content-right .form-group label{
			text-align: left;
			margin-left: 10px;
		}
		.layui-table-tool button{
			color:#95a1ab;
			background: #343f67;
		}
		.content-page .content{
			background: #212948;
			padding-top: 15px;
			margin: 70px 15px 15px 15px;
		}
		.layui-table-tool>.layui-table-tool-temp{
			padding-right: 0;
		}
		.table-tool-left{
			float: left;
		}
		.table-tool-right{
			float: right;
		}
		.table-content .layui-table-tool{
			background: #212948;
		}
		.table-content .layui-table thead tr{
			background: #212948;
		}
		.table-content .layui-table th,.table-content .layui-table-view{
			border:none;
		}
		.table-content .layui-table-view .layui-table{
			width:100%;
		}
		.table-content .layui-table-page a,.table-content .layui-table-page em{
			color:#95a1ab;
		}
		.table-content .layui-table-page span.layui-laypage-count {
			color:#95a1ab;
		}
	</style>
</head>

<body class="adminbody">
<div id="main">
	<!-- 头部导航 -->
	<div class="headerbar">
		<!-- LOGO -->
		<div class="headerbar-left">
			<a href="index.html" class="logo">
				<img alt="Logo" src="assets/images/logo.png" />
				<span>试验资源管理软件</span>
			</a>
		</div>

		<nav class="navbar-custom">
			<ul class="list-inline float-right mb-0">
				<li class="list-inline-item dropdown notif">
					<a class="nav-link dropdown-toggle arrow-none" data-toggle="dropdown" href="#" role="button"
					   aria-haspopup="false" aria-expanded="false">
						<i class="fa fa-fw fa-bell-o"></i><span class="notif-bullet"></span>
					</a>
					<div class="dropdown-menu dropdown-menu-right dropdown-arrow dropdown-lg">
						<!-- item-->
						<div class="dropdown-item noti-title">
							<h5><small><span class="label label-danger pull-xs-right">1</span>消息提醒</small></h5>
						</div>
						<!-- item-->
						<a href="#" class="dropdown-item notify-item">
							<div class="notify-icon bg-faded">
								<img src="assets/images/avatars/avatar2.png" alt="img"
									 class="rounded-circle img-fluid">
							</div>
							<p class="notify-details">
								<b>Admin</b>
								<span>用户信息注册成功</span>
								<small class="text-muted">3分钟前</small>
							</p>
						</a>
						<!-- All-->
						<a href="#" class="dropdown-item notify-item notify-all">
							查看所有消息
						</a>

					</div>
				</li>

				<li class="list-inline-item dropdown notif">
					<a class="nav-link dropdown-toggle nav-user" data-toggle="dropdown" href="#" role="button"
					   aria-haspopup="false" aria-expanded="false">
						<img src="assets/images/avatars/admin.png" alt="Profile image" class="avatar-rounded">
					</a>
					<div class="dropdown-menu dropdown-menu-right profile-dropdown ">
						<!-- item-->
						<div class="dropdown-item noti-title">
							<h5 class="text-overflow"><small>Hello, admin</small> </h5>
						</div>

						<!-- item-->
						<a href="pro-profile.html" class="dropdown-item notify-item">
							<i class="fa fa-user"></i> <span>个人中心</span>
						</a>

						<!-- item-->
						<a href="#" class="dropdown-item notify-item">
							<i class="fa fa-power-off"></i> <span>退出</span>
						</a>
					</div>
				</li>

			</ul>

			<ul class="list-inline menu-left mb-0">
				<li class="float-left">
					<button class="button-menu-mobile open-left">
						<i class="fa fa-fw fa-bars"></i>
					</button>
				</li>
			</ul>

		</nav>

	</div>
	<!-- 头部导航End -->
	<!-- 左侧导航开始 start-->
	<div class="left main-sidebar">
		<div class="sidebar-inner leftscroll">
			<div id="sidebar-menu">
				<ul>
					<li class="submenu">
						<a href="index.html"><i class="fa fa-fw fa-bars"></i><span>首页</span> </a>
					</li>
					<li class="submenu">
						<a href="#" ><i class="fa fa-fw fa-tv"></i> <span>试验资源注册模块</span>
							<span class="menu-arrow"></span>
						</a>
						<ul class="list-unstyled">
							<li><a href="szinfoRegister.html">实装信息注册</a></li>
							<li><a href="entityRegister.html">半实物装备信息注册</a></li>
							<li><a href="szfzmodelRegister.html">数字仿真模型信息注册</a></li>
							<li><a href="personRegistration.html">人员信息注册</a></li>
							<li><a href="ui-collapse.html">场地信息注册</a></li>
						</ul>
					</li>
					<li class="submenu">
						<a href="#">
							<i class="fa fa-fw fa-table"></i>
							<span> 资源导入导出模块</span>
							<span class="menu-arrow"></span>
						</a>
						<ul class="list-unstyled">
							<li><a href="szinfoImport.html">实装信息</a></li>
							<li><a href="ui-buttons.html">半实物装备信息</a></li>
							<li><a href="szfzmodelImport.html">数字仿真模型信息</a></li>
							<li><a href="ui-carousel.html">人员信息</a></li>
							<li><a href="ui-collapse.html">场地信息</a></li>
						</ul>
					</li>
					<li class="submenu active">
						<a href="#" class='active'><i class="fa fa-fw fa-file-text-o"></i> <span>试验资源编辑模块</span>
							<span class="menu-arrow"></span>
						</a>
						<ul class="list-unstyled">
							<li class="active"><a href="szinfoEdit.html">实装信息编辑</a></li>
							<li><a href="entityEdit.html">半实物装备信息编辑</a></li>
							<li><a href="szfzmodelEdit.html">数字仿真模型信息编辑</a></li>
							<li><a href="ui-carousel.html">人员信息编辑</a></li>
							<li><a href="ui-collapse.html">场地信息编辑</a></li>
						</ul>
					</li>
					<li class="submenu">
						<a href="#">
							<i class="fa fa-fw fa-th"></i>
							<span>综合资源查询模块 </span>
							<span class="menu-arrow"></span>
						</a>
						<ul class="list-unstyled">
							<li><a href="szinfoSearch.html">实装信息查询</a></li>
							<li><a href="ui-buttons.html">半实物装备信息查询</a></li>
							<li><a href="szfzmodelSearch.html">数字仿真模型信息查询</a></li>
							<li><a href="ui-carousel.html">人员信息查询</a></li>
							<li><a href="ui-collapse.html">场地信息查询</a></li>
						</ul>
					</li>
					<li class="submenu">
						<a href="javascript:;">
							<i class="fa fa-fw fa-area-chart"></i>
							<span> 试验资源监视模块 </span>
							<span class='menu-arrow'></span>
						</a>
						<ul class="list-unstyled">
							<li><a href="ui-alerts.html">实装信息监视</a></li>
							<li><a href="ui-buttons.html">半实物装备信息监视</a></li>
							<li><a href="ui-cards.html">数字仿真模型信息监视</a></li>
							<li><a href="ui-carousel.html">人员信息监视</a></li>
							<li><a href="ui-collapse.html">场地信息监视</a></li>
						</ul>
					</li>
				</ul>
				<div class="clearfix"></div>
			</div>
			<div class="clearfix"></div>

		</div>

	</div>

	<!-- End 左侧导航 -->
	<div class="content-page">
		<!-- Start content -->
		<!-- 数据表格 -->
		<div class="content table-content">
			<table class="layui-hide" id="test" lay-filter="test" lay-data="test"></table>
		</div>
	</div>
</div>
<!-- 左边工具栏 -->
<script type="text/html" id="toolbarDemo">
	<div class="layui-btn-container">
		<div class="table-tool-left">
			<!-- <button class="layui-btn" lay-event="getInputData" style="font-size:16px;" id="fileUpload">
				<img src="./assets/images/img/import.png" alt="">
				导入
			</button> -->
			<form method="post" enctype="multipart/form-data" style="width: 96px;height: 38px;background-color: #343f67;">
				<div id="iptDiv">
					<input id="fileUpload" name="fileUpload" type="file" accept=".doc,.xls" style="opacity:0;opacity: 0;
					display: block;
					cursor: pointer;
					width: 100%;">
				</div>
				<img src="./assets/images/img/import.png" alt="" style="margin-top: -59px;margin-left: 13px;">
				<span style="display: inline-block;color: #fff;width: 40px;height: 38px;float: right;margin-top: -36px;">导入</span> 
			</form>
			

			<button class="layui-btn export" lay-event="getOutputData" style="font-size:16px;margin-top: -38px;
			margin-left: 111px;float: left;">
				<img src="./assets/images/img/export.png" alt="">
				导出
			</button>
		</div>
		<div class="table-tool-right">
			<button class="layui-btn " lay-event="getDeleteData" style="font-size:16px;">
				<img src="./assets/images/img/delete.png" alt="" title="删除">
			</button>
			<button class="layui-btn" lay-event="getCopyLength" style="font-size:16px;">
				<img src="./assets/images/img/copy.png" alt="" title="复制">
			</button>
			<button class="layui-btn" lay-event="saveData" style="font-size:16px;">
				<img src="./assets/images/img/save.png" alt="" title="保存">
			</button>
		</div>
	</div>
</script>
<!-- 右边工具栏 -->
<script type="text/html" id="barDemo">
	<a class="layui-btn layui-btn-xs" lay-event="edit" style="color:#fff;">编辑</a>
</script>


<script src="assets/layui/layui.js"></script>

<script src="assets/layui/layui.all.js"></script>
<script src="assets/js/modernizr.min.js"></script>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/moment.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>


<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/jquery.nicescroll.js"></script>

<!-- App js -->
<script src="assets/js/pikeadmin.js"></script>
<!-- 验证表单 -->
<script src="assets/plugins/parsleyjs/parsley.min.js"></script>
<script src="assets/plugins/datetimepicker/js/moment.min.js"></script>
<script src="assets/plugins/datetimepicker/js/daterangepicker.js"></script>

<script>

	$('#form').parsley();
	$(function () {
		$('input[name="daterange"]').daterangepicker({
			timePicker: true,
			timePickerIncrement: 30,
			locale: {
				format: 'MM/DD/YYYY h:mm A'
			}
		});
	});

	var dateRange=``,paramArr=["name","type","number","unit"],editId;
	// ,"forces","inParams","outParams","state","location"
	
	
	// 数据表格
	layui.use('table', function(){
		var table = layui.table;
		// 表格数据展示
		table.render({
			elem: '#test',
			url:'/rm/physical/getAllEquipmentMessage',
			method:'post'
			,toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
			,defaultToolbar: []
			,title: '用户数据表'
			,cols: [[
				{type: 'checkbox', fixed: 'left'}
				,{field:'id', title:'ID',  fixed: 'left', width:60,unresize: true,align:'center'}
				,{field:'name', title:'名称', edit: 'text'}
				,{field:'type', title:'类型',  edit: 'text'}
				,{field:'number', title:'编号'}
				,{field:'unit', title:'研制单位', }
				,{field:'forces', title:'所属部队'}
				,{field:'inParams', title:'输入参数',}
				,{field:'outParams', title:'输出参数', }
				,{field:'state', title:'使用信息',}
				,{field:'location', title:'使用地址', }
				,{fixed: 'right', title:'操作', toolbar: '#barDemo',align:'center'}
			]]
			,page: {
				layout: [ 'prev', 'page', 'next', 'count','limit',  'skip']//自定义分页布局
				,limit:5
				,limits:[5,10,15]
				,first: false //不显示首页
				,last: false //不显示尾页
			}
			,request: {
				pageName: 'currentPage' //页码的参数名称，默认：page
				,limitName: 'pageSize' //每页数据量的参数名，默认：limit
			}
			,parseData: function(res){ //res 即为原始返回的数据
				return {
					"code": res.status, //解析接口状态
					"msg": res.msg, //解析提示文本
					"count": res.data.totalCount, //解析数据长度
					"data": res.data.lists //解析数据列表
				};
			}
		});
	
		//头工具栏事件
		table.on('toolbar(test)', function(obj){
			console.log("11313",obj)
			var checkStatus = table.checkStatus(obj.config.id);
			console.log(checkStatus);
			// 勾选中的整条数据
			var checkData = checkStatus.data,checkArr=[];
			console.log(checkData)

			//所勾选行id获取
			if (checkData.length>0){
				for (let i of  checkData){
					checkArr.push(i.id);
				}
				console.log(checkArr);
			}
			//工具栏
			switch(obj.event){
				
					// 删除
				case 'getDeleteData':
					layer.confirm('确认要删除吗？', {
						btn: ['确认','取消'] //按钮
					}, function(){
						if (checkArr.length>0){
							$.ajax({
								type : "POST",
								url : "/rm/physical/deleteMessages",
								//数据，json字符串
								data : {ids:checkArr.join(',')},
								success : function(res) {
									if (res.status==0){
										layer.msg('删除成功！',{time:2000});
										setTimeout(function(){
											window.parent.location.reload();
										},1000)
										
									}else {
										layer.msg('删除失败！',{time:2000});
									}
								},
								error : function(e){
									console.error(e.status);
									console.error(e.responseText);
								}
							});
						}
					});

					break;

					// 复制内容
				case 'getCopyLength':
					layer.confirm('确认要复制所勾选内容吗？', {
						btn: ['确认','取消'] //按钮
					}, function(){
						if (checkArr.length>0){
							$.ajax({
								type : "POST",
								// contentType: "application/json",
								url : "/rm/physical/copy",
								data :  {ids:checkArr.join(',')},
								//请求成功
								success : function(res) {
									console.log(res);
									if (res.status==0){
										layer.msg('复制成功！',{time:2000});
										setTimeout(function(){
											window.parent.location.reload();
										},1000)
									}else {
										layer.msg('复制失败！',{time:2000});
									}

								},
								//请求失败，包含具体的错误信息
								error : function(e){
									// console.error(e.status);
									// console.error(e.responseText);
								}
							});
						}
					})

					break;
					// 保存
				case 'saveData':
					layer.msg('保存');
					break;
			};
		
		});

		//监听行工具事件
		table.on('tool(test)', function(obj){
			var data = obj.data;
				editId=data.id;
			if(obj.event === 'edit'){
				handleEdit(editId);
               
			}
		});
	
	});
	

	// 导入信息表之前下载示例
	$("#fileUpload").click(function(){
		var formData = $("input[name='fileUpload']")[0].files[0];
		console.log($("input[name='fileUpload']")[0].files)
		// 导入需要先下载excel插件
		$.ajax({
		//请求地址
			url : "/rm/physical/exportHeader",
			type : "post",
			success:function(res){
				layer.msg("请下载示例")
			}
		});
	});
	
	// 导入信息表
	$("#fileUpload").on("change", function () {
		var form = new FormData();
        var files = $(this)[0].files; //$(this)[0] 等价于 $(this).get(0)，将 JQuery 对象转为 DOM 对象，files 为其属性，得到的是一个文件对象数组
		if(files.length>0){//未选中文件时，长度为0

			form.append("file",files[0]);
			$.ajax({
				type : "post",
				url : "/rm/physical/import",
				data : form,
				async: false,
				cache: false,   //上传文件不需要缓存
				contentType: false,  //需设置为false。因为是FormData对象，且已经声明了属性enctype="multipart/form-data"
				processData: false,  //需设置为false。因为data值是FormData对象，不需要对数据做处理
				//请求成功
				success : function(res) {
					if (res.status==0){
						layer.msg('上传成功！',{time:2000});
					}else {
						layer.msg('上传失败！',{time:2000});
					}
				},
				error : function(e){
					
				}
			})
		}else{
			layer.msg("请选择文件进行上传")
		};

	});
            
	//导出信息表
	$('.export').on('click',function () {
		window.location.href="/rm/physical/export";
	});


	//	编辑
    function handleEdit(editId){
		
		// 每一行的编辑id
		var id = editId;
		console.log("编辑id",id);

		$.ajax({
			url:"/rm/physical/getMessageDetail",
			type:"post",
			data:{"id":id},
			success:function(result){
					
					console.log("11111",result.data.message)
				layer.open({
					type: 1 //Page层类型
					,area: ['1400px', '700px']
					,title: false
					,shade: 0.4 //遮罩透明度
					,maxmin: false //允许全屏最小化
					,anim: 1 //0-6的动画形式，-1不开启
					,content: `
					<div class="content-page" style="margin-left:0;background:#212948;">
					<!-- Start content -->
					<div class="content" style="margin-top:20px;">
						<div class="row">
							<div class="col-xs-12 col-sm-12 col-md-5 col-lg-5 col-xl-5">
								<div class="card mb-3">
									<div class="card-header">
										<h3>
											<!-- 缺图标 -->
											<!-- <i class="fa fa-user"></i> -->
											实物装备列表
										</h3>
									</div>
									<div class="card-body" style='height:500px;'>
										<form action="#" data-parsley-validate novalidate>
											<div class="form-group">
													<label for="type">具体装备名称值：<span class="text-danger">*</span></label>
													<input type="text" name="type" data-parsley-trigger="change" required
														placeholder="请输入装备名称" class="form-control" id="name">
												</div>
											<div class="form-group">
												<label for="type">类型<span class="text-danger">*</span></label>
												<input type="text" name="type" data-parsley-trigger="change" required
													placeholder="请输入类型" class="form-control" id="type">
											</div>
											<div class="form-group">
												<label for="number">编号<span class="text-danger">*</span></label>
												<input type="text" name="number" data-parsley-trigger="change" required
													placeholder="请输入编号" class="form-control" id="number">
											</div>
											<div class="form-group">
												<label for="organization">研制单位<span class="text-danger">*</span></label>
												<input type="text" name="organization" data-parsley-trigger="change" required
													placeholder="请输入研制单位" class="form-control" id="unit">
											</div>
											<div class="form-group">
												<label for="troops">所属部队
													<span class="text-danger">*</span>
												</label>
												<select required class="form-control" id="forces">
													<option value="">请选择</option>
													<option value="部队一">部队一</option>
													<option value="部队二">部队二</option>
													<option value="部队三">部队三</option>
												</select>
											</div>

											<div class="form-group">
												<label for="troops">装备名称/仿真模型
													<span class="text-danger">*</span>
												</label>
												<select required class="form-control" id="equipType">
													<option value="">请选择</option>
												</select>
											</div>
											<div class="form-group">
												<label for="stateMsg">状态信息
													<span class="text-danger">*</span>
												</label>
												<select required class="form-control" id="state">
													<option value="">请选择</option>
													<option value="使用" id="0">使用</option>
													<option value="未使用" id="1">未使用</option>
													<option value="待使用" id="3">待使用</option>
												</select>
											</div>

										</form>
									</div>
								</div><!-- end card-->
							</div>
							<div class="col-xs-12 col-sm-12 col-md-7 col-lg-7 col-xl-7">
								<div class="card mb-3 content-right">
									<div class="card-header">
										<h3>
											<!-- <i class="fa fa-hand-pointer-o"></i> -->
											信息填写</h3>
									</div>

									<div class="card-body card-height" style='height:500px;'>
										<form class="demo-form" action="#">
											<div class="row" style="justify-content: space-between;height: 90px;overflow-y: scroll;" id="mainPerformance">
												<h6 class=" col-xs-12 col-md-12 col-lg-12 sub-text">主要性能</h6>

											</div>
											<div class="row" style="justify-content: space-around;">
												<h6 class=" col-xs-12 col-md-12 col-lg-12 sub-text" style="margin-bottom:10px;">输入输出接口参数</h6>
												<div class=" col-md-6 col-lg-6">
													<div class="form-group">
														<label for="inputInterface">输入接口</label>
														<input type="text" name="inputInterface" placeholder="请填写输入接口" class="form-control"
															id="inParams">
													</div>
												</div>
												<div class=" col-md-6 col-lg-6">
													<div class="form-group">
														<label for="outputInterface">输出接口</label>
														<input type="text" name="outputInterface" placeholder="请填写输出接口" class="form-control"
															id="outParams">
													</div>
												</div>
											</div>
											
											<div class="form-group">
													<label for="useAddress">使用地点</label>
													<input type="text" name="useAddress" placeholder="请输入使用地点" class="form-control"
														id="location">
											</div>
											<!-- <div class="form-group"> -->
												<div class="layui-form" >
													<div class="layui-form-item" >
														<label class="layui-form-label" style="width: 24%;text-align: left;color: #95a1ab;font-size: 1rem;">日期范围</label>
														<div class="layui-input-inline " style="width: 76%; margin-right: 0px;">
															<input type="text" class="layui-input form-control" id="test6" placeholder="请选择日期范围" 
																style="background:#343f67;border-radius: 4px;border:none;">
														</div>
													</div>
												</div>
											<!-- </div> -->
										</form>
									</div>
								</div><!-- end card-->
							</div>
							<div id="myForm" class="form-group col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6" style='margin: 20px auto'>
								<button class="btn btn-primary btn-size col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6"
									type="submit" id="submitBtn" onclick="handleSubmit()">
									提交
								</button>
							</div>

						</div>
					</div>
				</div>`
            	,success: function(layero, index){

						var paramObj={},inpVal='',dateObj,obj,str='';

						// 输入框的值的回显
						$.each(result.data.message,function(index,item){
							$("#"+index+"").val(item)
						})
							
						//	主要性能获取
						// for (let k of result.data.message.performances){
						// 	console.log(k)
						// 	str+=`<div class="col-xs-4">
						// 		<div class="form-group">
						// 			<label  style="margin-left: 20px;">${k.name}</label>
						// 			<input type="text"   class="form-control" value=${k.value}>
						// 		</div>
						// 	</div>`;

						// }
						// var ele=$(".content-right form .row:first-child ");
						// ele.append(str);
						// layui.use('laydate', function(){
						// 	var laydate = layui.laydate;
						// 	laydate.render({
						// 		elem: '#test6'
						// 		,range: true
						// 		,value: `${data.startTime} - ${data.endTime}` //必须遵循format参数设定的格式
						// 		,done: function(value, date, endDate){
						// 			console.log(value); //得到日期生成的值，如：2017-08-18
						// 			dateRange=value;
						// 			console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
						// 			console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。
						// 		}
						// 	});
						// })
            		}
        		});
   
			}
		})

    }

	//  提交
	function handleSubmit() {
		
		// 获取页面上输入框的值
		var paramObj={}
		var obj;

		//获取所有输入框的值 （名称，类型，编号，研制单位，输入接口，输出接口，使用地点）
		var paramArr=["name","type","number","unit","forces","inParams","outParams","state","location"]
		var inpVal=''
		$.each(paramArr,function(index,item){
			inpVal=$("#"+item+"").val();
			paramObj[item]=inpVal;
		})

		//	主要性能获取
		var arr = [],startDate,endDate,dataArr=dateRange?dateRange.split(' '):['','',''];
		var propertyArr=$(".content-right form .row:first-child .col-xs-4 .form-group");
		for (let k=0;k<propertyArr.length;k++){
			var eve=propertyArr[k]
			var name=$(eve).children('label').text();
			var value=$(eve).children('input').val();
			arr.push(
					{
						"typeId":equipId,
						"typeValue":value
					}
				);
		}
		console.log("性能",arr);
		
		// 获取下拉框选中的值（所选部队，装备名称/仿真模型，状态信息，状态信息id）
		var forces = $("#forces option:checked").val();
			var name = $("#equipType option:checked").val();
			var state = $("#state option:checked").val();
			var stateId = $("#state").find("option:checked").attr("id");
			var selectObj = {
				forces:forces,
				name:name,
				state:state
			}	

		// 获取时间值
		startDate=dataArr[0];
		endDate=dataArr[2];
		dateObj={ startTime:startDate,endTime:endDate}
		
		// 将输入框得到的对象，和下拉框得到的对象进行合并
		obj = Object.assign(paramObj,selectObj,dateObj,{id:editId});
		obj.id = null;
		obj.performances=null;
		// obj.startTime=null;
		// obj.endTime=null;
		obj.locationStartTime="10:00";
		obj.locationEndTime="10:00";
		obj.id=editId;

		console.log(obj)
		
		//提交编辑请求
		$.ajax({
			//请求方式
			type : "POST",
			//请求的媒体类型
			// contentType: "application/json",
			//请求地址
			url : "/rm/physical/updateEquipmentMessage",
			//数据，json字符串
			data : obj,
			//请求成功
			success : function(res) {
				console.log(res);
				if (res){
					layer.msg('提交成功！');
					layer.closeAll();
					//刷新数据
					$(".layui-laypage-btn")[0].click();
				}else {
					layer.msg('提交失败！');
				}

			},
			//请求失败，包含具体的错误信息
			error : function(e){
				layer.msg('系统数据Error！');
			}
		});
	}

	
	
</script>
</body>

</html>